package phone.qyg.com.qyg.model;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/**
 * 作者：lblbh on 2017/12/1 17:29
 * 邮箱：lanbuhan@163.com
 * 功能：讨论
 */
public class Discuss implements Parcelable {
    /**
     *    "id": 14,
     “userId”:10070      //会员ID
     "content": "详细地址",
     "userName": “张三”   //评
     论用户昵称
     "fixImgUrl":
     “http://domain:port/data/2017/03/29/3243df.jpg”,  //头像图片
     "dateDiff": “4小时前”, // 评论时间，大于24小时显示几天前，小于1小时显示几分钟前，小于1分钟显示刚刚

     //场馆、健身俱乐部详情需要参数
     "star": 4,  //评论星级
     "praiseStatus": 0,  //0-未点赞，1-已点赞

     */

    public int id;
    public int star;
    public int type; //1-场馆 2-活动
    public int userId;
    public int objectId;//相应活动/场馆 id
    public int praiseStatus;
    public boolean isFoot;//true-显示底部 false-不显示
    public String title;
    public String fixImgUrl;
    public String content;
    public String userName;
    public String dateDiff;
    public List<DiscussItem> ansList;//二级集合


    public Discuss() {}


    @SuppressWarnings("unchecked")
    public Discuss(Parcel in) {
        id = in.readInt();
        type = in.readInt();
        userId = in.readInt();
        objectId = in.readInt();
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(id);
        dest.writeInt(type);
        dest.writeInt(userId);
        dest.writeInt(objectId);
    }


    public static final Creator<Discuss> CREATOR = new Creator<Discuss>() {
        @Override
        public Discuss[] newArray(int size) {
            return new Discuss[size];
        }

        @Override
        public Discuss createFromParcel(Parcel in) {
            return new Discuss(in);
        }
    };
}
